home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2002 #11
/
Amiga Plus CD - 2002 - No. 11.iso
/
Tools
/
Development
/
PowerD
/
powerd
/
source
/
lib
/
powerd_lib.lha
/
PowerD_PPC
/
StrAdd.ass
< prev
next >
Wrap
Text File
|
2000-10-15
|
548b
|
28 lines
# StrAdd(r3:PTR TO CHAR,r4:PTR TO CHAR,r5=-1:LONG)
.text
.global _StrAdd
_StrAdd:
subi r6,r3,1 # find the end of the destination string
.find: lbzu r0,1(r6)
mr. r0,r0
bne .find
subi r4,r4,1
subi r6,r6,1
.loop: lbzu r0,1(r4) # get char from source
stbu r0,1(r6) # put char to destination
mr. r0,r0 # source end?
beq .finish
subi r5,r5,1 # length done?
mr. r5,r5
bne .loop
li r0,0 # finish with zero byte
stb r0,1(r6)
.finish: blr # r3 contains destination string pointer
.type _StrAdd,@function
.size _StrAdd,$-_StrAdd